<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html" xmlns:s="http://jboss.com/products/seam/taglib"
      xmlns:a="http://richfaces.org/a4j">
<body>
<ui:composition template="/WEB-INF/template.xhtml">

    <ui:define name="body">
        Авторизация → <span class="current_header">Адрес доставки</span> → Подверждение

        <p><span class="required">*</span> — поля, обязательные для заполнения.</p>


        <div style="width: 100%;">

            <f:subview id="no_order" rendered="#{currentOrder==null}">
                <p>You have no order.</p>
            </f:subview>


            <f:subview id="addressaction" rendered="#{currentOrder != null}">
                <h:form id="AddressActionForm" styleClass="addressForm">

                    <h:messages globalOnly="true"/>
                    <s:validateAll>


                        <s:decorate template="edit.xhtml" id="name">
                            <ui:define name="label">Ф.И.О. получателя</ui:define>
                            <h:inputText value="#{currentOrder.customer.firstName}" size="54"
                                         title="Например: Милованов Пётр Антонович" required="true">
                                <a:support event="onblur" reRender="name"/>
                            </h:inputText>
                        </s:decorate>


                        <s:decorate template="edit.xhtml" id="index">
                            <ui:define name="label">Индекс</ui:define>
                            <h:inputText value="#{currentOrder.customer.zip}" size="6"
                                         title="Например: 443110" required="true">
                                <a:support event="onblur" reRender="index"/>
                            </h:inputText>
                        </s:decorate>


                        <s:decorate template="edit.xhtml" id="address">
                            <ui:define name="label">Адрес</ui:define>
                            <h:inputTextarea value="#{currentOrder.customer.address1}" rows="2"
                                             cols="57" required="true" title="Например: г. Самара, ул. Ново-Садовая, д. 57, кв. 2">
                                <a:support event="onblur" reRender="address"/>
                            </h:inputTextarea>
                        </s:decorate>


                        <s:decorate template="edit.xhtml" id="phone">
                            <ui:define name="label">Телефон</ui:define>
                            <h:inputText value="#{currentOrder.customer.phone}" size="36"
                                         title="Например: +7 905 304 2007" required="true">
                                <a:support event="onblur" reRender="phone"/>
                            </h:inputText>
                        </s:decorate>


                        <h:outputLabel for="comment" value="Комментарий"/>
                        <h:inputTextarea id="comment" value="#{currentOrder.comment}" rows="2" cols="57"/><br/>

                    </s:validateAll>

                    <br/>
                    <h:commandButton id="BackButton"
                                     type="submit"
                                     action="back"
                                     value="Назад" immediate="true"/>

                    &#160; &#160;
                    <h:commandButton id="SubmitAddressButton"
                                     type="submit"
                                     action="address"
                                     value="#{messages.submitAddressButton}"/>
                </h:form>
            </f:subview>

        </div>
    </ui:define>
</ui:composition>
</body>
</html>
